set t_Co=256
set nu  " 显示行号
set expandtab   " tab替换为空格，空格个数为tabstop
set tabstop=4   " tab替换为空格时，空格的个数
set shiftwidth=4    " 一次缩进，4个空格
set hlsearch    " 搜索时高亮
set incsearch   " 输入时，及时搜索
set showcmd     " 显示输入的指令
set ruler       " 显示当前光标行号和列号
set cursorline  " 高亮当前光标所在行
set cursorcolumn    " 高亮当前光标所在列
set ic          " 搜索时忽略大小写
set smartindent     " 自动缩进
set laststatus=2    " 2总显示最后一个窗口的状态行，1窗口多于一个时显示最后一个窗口的状态行，0不显示最后一个窗口的状态行
set iskeyword=@,48-57,_,192-255     " 用来确定单词边界的字符
set completeopt-=preview   "disable scratch preview window

filetype on
filetype plugin on
filetype indent on 

let g:rehash256 = 1
let g:molokai_original = 1
syntax on
colorscheme molokai


"autocmd BufRead,BufNewFile *.ftl set filetype=html
autocmd BufRead,BufNewFile *.ftl set filetype=ftl
autocmd BufRead,BufNewFile *.scala set filetype=scala
autocmd BufRead,BufNewFile *.md set filetype=markdown

" 将 pathogen 自身也置于独立目录中，需指定其路径 
" runtime bundle/autoload/pathogen.vim
" 运行 pathogen
execute pathogen#infect()

" statusline ==>
set statusline= 
set statusline+=%7*\(%n)                                  "buffernr  
set statusline+=%1*\ %<%F\                                "文件路径  
set statusline+=%2*\ %=%y\                                  "文件类型  
set statusline+=%3*\ %=%{''.(&fenc!=''?&fenc:&enc).''}      "编码1  
set statusline+=%3*\ %=%{(&bomb?\",BOM\":\"\")}\            "编码2  
set statusline+=%4*\ %=%{&ff}\                              "文件系统(dos/unix..)   
set statusline+=%5*\ %=%{&spelllang}\%{HighlightSearch()}\  "语言 & 是否高亮，H表示高亮?  
set statusline+=%8*\ %=\ row:%l/%L\ (%03p%%)\             "光标所在行号/总行数 (百分比)  
set statusline+=%9*\ col:%03c\                            "光标所在列  
set statusline+=%0*\ \ %m%r%w\ %P\ \                      "Modified? Read only? Top/bottom  
function! HighlightSearch()  
  if &hls  
      return 'H'  
  else  
      return ''  
  endif  
endfunction  
hi User1 ctermfg=77        ctermbg=235
hi User2 ctermfg=77        ctermbg=235
hi User3 ctermfg=white     ctermbg=100  
hi User4 ctermfg=11        ctermbg=95  
hi User5 ctermfg=darkred   ctermbg=77  
hi User7 ctermfg=white     ctermbg=darkred     cterm=bold  
hi User8 ctermfg=231       ctermbg=blue  
"hi User9 ctermfg=#ffffff  ctermbg=#810085  
hi User0 ctermfg=yellow  ctermbg=138  
" <== statusline

